IDataProvider
| Kind of class: | interface |
|---|---|
| Inherits from: | none |
| Classpath: | gfx.interfaces.IDataProvider |
| File last modified: | Tuesday, 29 June 2010, 09:03:27 |
Defines the methods that all DataProviders should expose. Note that this interface is not implemented by the existing components, and does not need to be implemented, it is just a reference. There are additional properties and getter/setters defined in the interface, which are commented out for compiler compatibility.
Summary
Instance methods
- requestItemAt
- Request an item from the given index.
- requestItemRange
- Request an item range from the given index.
- indexOf
- Get the index of an item in the DataProvider.
- invalidate
- The dataProvider has changed.
Instance methods
indexOf
function indexOf (
item:Object,
scope:Object,
callBack:String) : Number
Get the index of an item in the DataProvider. Although this method returns an number, the components that use it all expect the item to be returned using the scope/callBack to support delayed data results when dealing with the Game Engine.
Parameters:
value :
The item in the DataProvider
scope :
The scope for the callBack
callBack:
The callBack function name
Returns:
- The index of the item in the DataProvider, or -1 if not found.
invalidate
function invalidate (
length:Number) : Void
The dataProvider has changed.
Parameters:
length:
the current length of the data set, which needs to be kept up to date.
requestItemAt
function requestItemAt (
index:Number,
scope:Object,
callBack:String) : Object
Request an item from the given index. Although this method returns an object, the components that use it all expect the item to be returned using the scope/callBack to support delayed data results when dealing with the Game Engine.
Parameters:
index :
The index in the DataProvider
scope :
The scope for the callBack
callBack:
The callBack function name
Returns:
- The requested item, if it is immediately available. Note that components will not use the return value.
requestItemRange
function requestItemRange (
startIndex:Number,
endIndex:Number,
scope:Object,
callBack:String) : Array
Request an item range from the given index. Although this method returns an object, the components that use it all expect the item to be returned using the scope/callBack to support delayed data results when dealing with the Game Engine.
Parameters:
index :
The start index of the requested item range
endIndex:
The end index of the requested item range
scope :
The scope for the callBack
callBack:
The callBack function name
Returns:
- The items in the range, if they are immediately available. Note that components will not use the return value.